package com.itheima.dao;

import com.itheima.domain.Collection2;
import com.itheima.domain.Likes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LikesDao {
    @Insert("insert into likes  values(null,#{aid}, #{uid})")
    public int save(Likes likes);

    @Delete("delete from likes where  aid = #{aid} and uid =#{uid}")
    public int delete(Likes likes);

    @Select("select * from likes where aid = #{aid} and uid = #{uid} ")
    public Likes getById(Likes likes);

    @Select("select * from likes")
    public List<Likes> getAll();
}
